import config from "@/config"
import http from "@/utils/request"

export default {
	menu: {
		myMenus: {
			url: `${config.API_URL}/xunheng-system/permission/getUserPermission`,
			name: "获取我的菜单",
			get: async function(){
				return await http.get(this.url);
			}
		},
		list: {
			url: `${config.API_URL}/xunheng-system/permission/getAllList`,
			name: "获取菜单",
			get: async function(){
				return await http.get(this.url);
			}
		},
		add:{
			url: `${config.API_URL}/xunheng-system/permission/add`,
			name: "保存菜单",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
		edit:{
			url: `${config.API_URL}/xunheng-system/permission/edit`,
			name: "编辑菜单",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
		delete:{
			url: `${config.API_URL}/xunheng-system/permission/delByIds/`,
			name: "删除角色",
			delete: async function(ids){
				return await http.delete(this.url+`${ids}`);
			}
		}
	},
	organization:{
		list: {
			url: `${config.API_URL}/xunheng-system/organization/getList`,
			name: "获取组织架构",
			get: async function(params){
				return await http.get(this.url,params);
			}
		},
		pageList: {
			url: `${config.API_URL}/xunheng-system/organization/getPageList`,
			name: "组织架构分页",
			get: async function(params){
				return await http.get(this.url,params);
			}
		},
		add:{
			url: `${config.API_URL}/xunheng-system/organization/add`,
			name: "保存组织架构",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
		edit:{
			url: `${config.API_URL}/xunheng-system/organization/edit`,
			name: "编辑组织架构",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
		delete:{
			url: `${config.API_URL}/xunheng-system/organization/delByIds/`,
			name: "删除组织架构",
			delete: async function(ids){
				return await http.delete(this.url+`${ids}`);
			}
		},

	},
	dict: {
		tree: {
			url: `${config.API_URL}/xunheng-system/dict/getAll`,
			name: "获取字典树",
			get: async function(){
				return await http.get(this.url);
			}
		},
		save:{
			url: `${config.API_URL}/xunheng-system/dict/add`,
			name: "保存字典",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
		edit:{
			url: `${config.API_URL}/xunheng-system/dict/edit`,
			name: "修改字典",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
		delete:{
			url: `${config.API_URL}/xunheng-system/dict/delByIds/`,
			name: "删除字典",
			delete: async function(ids){
				return await http.delete(this.url+`${ids}`);
			}
		},
		get: {
			url: `${config.API_URL}/xunheng-system/dict/get`,
			name: "获取字典数据",
			get: async function(params){
				return await http.get(this.url, params);
			}
		}
	},
	dictData: {
		list: {
			url: `${config.API_URL}/xunheng-system/dictData/getPageListByType`,
			name: "获取字典数据列表",
			get: async function(params){
				return await http.get(this.url,params);
			}
		},
		getByType: {
			url: `${config.API_URL}/xunheng-system/dictData/getByType`,
			name: "获取所有字典数据",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		save:{
			url: `${config.API_URL}/xunheng-system/dictData/add`,
			name: "保存字典数据",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
		edit:{
			url: `${config.API_URL}/xunheng-system/dictData/edit`,
			name: "修改字典数据",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
		delete:{
			url: `${config.API_URL}/xunheng-system/dictData/delByIds/`,
			name: "删除字典数据",
			delete: async function(ids){
				return await http.delete(this.url+`${ids}`);
			}
		},
		enable:{
			url: `${config.API_URL}/xunheng-system/dictData/enable/`,
			name: "启用字典数据",
			post: async function(ids){
				return await http.post(this.url+`${ids}`);
			}
		},
		disable:{
			url: `${config.API_URL}/xunheng-system/dictData/disable/`,
			name: "禁用字典数据",
			post: async function(ids){
				return await http.post(this.url+`${ids}`);
			}
		},
	},
	role: {
		getSelectItem:{
			url: `${config.API_URL}/xunheng-system/role/getSelectItem`,
			name: "获取选择项",
			get: async function(params){
				return await http.get(this.url,params);
			}
		},
		list: {
			url: `${config.API_URL}/xunheng-system/role/getPageList`,
			name: "获取角色列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		listAll: {
			url: `${config.API_URL}/xunheng-system/role/getAllList`,
			name: "获取所有角色列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		save:{
			url: `${config.API_URL}/xunheng-system/role/save`,
			name: "保存角色",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
		edit:{
			url: `${config.API_URL}/xunheng-system/role/edit`,
			name: "编辑角色",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
		delete:{
			url: `${config.API_URL}/xunheng-system/role/delAllByIds/`,
			name: "删除角色",
			delete: async function(ids){
				return await http.delete(this.url+`${ids}`);
			}
		},
		editRolePerm:{
			url: `${config.API_URL}/xunheng-system/role/editRolePerm`,
			name: "分配菜单权限",
			post: async function(params){
				return await http.post(this.url, params);
			}
		}
	},
	tenant: {
		list: {
			url: `${config.API_URL}/xunheng-system/tenant/getPageList`,
			name: "获取租户列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		save:{
			url: `${config.API_URL}/xunheng-system/tenant/save`,
			name: "保存租户",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
		edit:{
			url: `${config.API_URL}/xunheng-system/tenant/edit`,
			name: "编辑租户",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
		delete:{
			url: `${config.API_URL}/xunheng-system/tenant/delByIds/`,
			name: "删除租户",
			delete: async function(ids){
				return await http.delete(this.url+`${ids}`);
			}
		}
	},
	tenantAuth: {
		list: {
			url: `${config.API_URL}/xunheng-system/tenantAuthRecord/getPageList`,
			name: "获取租户授权记录列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		save:{
			url: `${config.API_URL}/xunheng-system/tenantAuthRecord/save`,
			name: "保存租户授权记录",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
		edit:{
			url: `${config.API_URL}/xunheng-system/tenantAuthRecord/edit`,
			name: "编辑租户授权记录",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
		delete:{
			url: `${config.API_URL}/xunheng-system/tenantAuthRecord/delByIds/`,
			name: "删除租户授权记录",
			delete: async function(ids){
				return await http.delete(this.url+`${ids}`);
			}
		}
	},
	user: {
		list: {
			url: `${config.API_URL}/xunheng-system/user/getPageList`,
			name: "获取用户列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		save:{
			url: `${config.API_URL}/xunheng-system/user/admin/add`,
			name: "添加用户",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
		edit:{
			url: `${config.API_URL}/xunheng-system/user/admin/edit`,
			name: "修改用户",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
		userCenterEdit:{
			url: `${config.API_URL}/xunheng-system/user/edit`,
			name: "用户中心修改用户",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
		delete:{
			url: `${config.API_URL}/xunheng-system/user/delByIds/`,
			name: "删除用户",
			delete: async function(ids){
				return await http.delete(this.url+`${ids}`);
			}
		},
		resetPassword:{
			url: `${config.API_URL}/xunheng-system/user/resetPass/`,
			name: "重置密码",
			post: async function(ids){
				return await http.post(this.url+`${ids}`);
			}
		},
		editPassword:{
			url: `${config.API_URL}/xunheng-system/user/modifyPass`,
			name: "修改密码",
			post: async function(params){
				return await http.post(this.url,params);
			}
		},
		enable:{
			url: `${config.API_URL}/xunheng-system/user/admin/enable/`,
			name: "启用用户",
			post: async function(ids){
				return await http.post(this.url+`${ids}`);
			}
		},
		disable:{
			url: `${config.API_URL}/xunheng-system/user/admin/disable/`,
			name: "禁用用户",
			post: async function(ids){
				return await http.post(this.url+`${ids}`);
			}
		},
		info: {
			url: `${config.API_URL}/xunheng-system/user/info/`,
			name: "获取token用户信息",
			get: async function(token){
				return await http.get(this.url+`${token}`);
			}
		},
		getOneById: {
			url: `${config.API_URL}/xunheng-system/user/getOneById/`,
			name: "根据id获取用户",
			get: async function(id){
				return await http.get(this.url+`${id}`);
			}
		},
		getSelectItem:{
			url: `${config.API_URL}/xunheng-system/user/getSelectItem`,
			name: "获取选择项",
			get: async function(params){
				return await http.get(this.url,params);
			}
		}
	},
	esLog: {
		list: {
			url: `${config.API_URL}/xunheng-log/sysLog/getPageList`,
			name: "ES日志列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		echartsList: {
			url: `${config.API_URL}/xunheng-log/sysLog/getEchartsData`,
			name: "Echarts数据",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		clean: {
			url: `${config.API_URL}/xunheng-log/sysLog/clean`,
			name: "清空日志",
			delete: async function(params){
				return await http.delete(this.url, params);
			}
		},
	},
	saSession:{
		list: {
			url: `${config.API_URL}/xunheng-system/saSession/getAll`,
			name: "获取session会话列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		kickOut:{
			url: `${config.API_URL}/xunheng-system/saSession//kickOut/`,
			name: "下线用户",
			delete: async function(token){
				return await http.delete(this.url+`${token}`);
			}
		},
		changeSession:{
			url: `${config.API_URL}/xunheng-system/saSession//changeSession/`,
			name: "切换身份",
			post: async function(token){
				return await http.post(this.url+`${token}`);
			}
		},
	},
	task:{
		list: {
			url: `${config.API_URL}/xunheng-quartz/quartz/getPageList`,
			name: "获取定时任务列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		listAll: {
			url: `${config.API_URL}/xunheng-quartz/quartz/getAll`,
			name: "获取所有定时任务列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		save:{
			url: `${config.API_URL}/xunheng-quartz/quartz/add`,
			name: "保存定时任务",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
		pause:{
			url: `${config.API_URL}/xunheng-quartz/quartz/pause/`,
			name: "暂停定时任务",
			post: async function(id){
				return await http.post(this.url+`${id}`);
			}
		},
		resume:{
			url: `${config.API_URL}/xunheng-quartz/quartz/resume/`,
			name: "恢复定时任务",
			post: async function(id){
				return await http.post(this.url+`${id}`);
			}
		},
		edit:{
			url: `${config.API_URL}/xunheng-quartz/quartz/edit`,
			name: "编辑定时任务",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
		delete:{
			url: `${config.API_URL}/xunheng-quartz/quartz/delByIds/`,
			name: "删除定时任务",
			delete: async function(id){
				return await http.delete(this.url+`${id}`);
			}
		},
		execute:{
			url: `${config.API_URL}/xunheng-quartz/quartz/execute/`,
			name: "执行一次定时任务",
			post: async function(id){
				return await http.post(this.url+`${id}`);
			}
		},
	},
	taskLog:{
		list: {
			url: `${config.API_URL}/xunheng-quartz/quartzLog/getPageList`,
			name: "获取定时任务日志列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
	},
	notice:{
		list: {
			url: `${config.API_URL}/xunheng-system/notice/getPageList`,
			name: "获取读系统信息列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		unReadNotice: {
			url: `${config.API_URL}/xunheng-system/notice/getUnReadNoticeList`,
			name: "获取未读系统信息列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		markRead:{
			url: `${config.API_URL}/xunheng-system/notice/markRead/`,
			name: "标记已读",
			post: async function(id){
				return await http.post(this.url+`${id}`);
			}
		},
		markReadAll:{
			url: `${config.API_URL}/xunheng-system/notice/markReadAll`,
			name: "标记所有已读",
			post: async function(){
				return await http.post(this.url);
			}
		},
	},
	customConfig:{
		savePersonalConfig:{
			url: `${config.API_URL}/xunheng-system/customConfig/savePersonalConfig`,
			name: "保存个性化设置",
			post: async function(type,data){
				let params = {
					configKey:type,
					configValue:data
				}
				return await http.post(this.url, params);
			}
		},
		saveExtendConfig:{
			url: `${config.API_URL}/xunheng-system/customConfig/saveExtendConfig`,
			name: "保存系统拓展设置",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
		extendConfigList: {
			url: `${config.API_URL}/xunheng-system/customConfig/getExtendConfigList`,
			name: "获取系统拓展配置",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		delete:{
			url: `${config.API_URL}/xunheng-system/customConfig/delByIds/`,
			name: "删除配置",
			delete: async function(ids){
				return await http.delete(this.url+`${ids}`);
			}
		}
	},
	matrix:{
		list: {
			url: `${config.API_URL}/xunheng-system/matrix/getPageList`,
			name: "获取矩阵列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		listAll: {
			url: `${config.API_URL}/xunheng-system/matrix/getAll`,
			name: "获取所有矩阵列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		save:{
			url: `${config.API_URL}/xunheng-system/matrix/save`,
			name: "保存矩阵",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
		edit:{
			url: `${config.API_URL}/xunheng-system/matrix/edit`,
			name: "编辑矩阵",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
		delete:{
			url: `${config.API_URL}/xunheng-system/matrix/delByIds/`,
			name: "删除矩阵",
			delete: async function(id){
				return await http.delete(this.url+`${id}`);
			}
		},
	},
	matrixColumn:{
		save:{
			url: `${config.API_URL}/xunheng-system/matrixColumn/save`,
			name: "保存矩阵列",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
		getByMatrix:{
			url: `${config.API_URL}/xunheng-system/matrixColumn/getByMatrix/`,
			name: "获取矩阵列",
			get: async function(id){
				return await http.get(this.url+`${id}`);
			}
		}
	},
	matrixData:{
		save:{
			url: `${config.API_URL}/xunheng-system/matrixData/save`,
			name: "保存矩阵表格数据",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
		getByMatrix:{
			url: `${config.API_URL}/xunheng-system/matrixData/getByMatrix/`,
			name: "获取矩阵表格数据",
			get: async function(id){
				return await http.get(this.url+`${id}`);
			}
		}
	},
	feedback:{
		save:{
			url: `${config.API_URL}/xunheng-system/feedback/save`,
			name: "提交意见反馈",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
	}
}
